<div class="admin_title_header">
  <h3>Tax Rates</h3>
  <%= link_to 'New Tax rate', new_admin_config_tax_rate_path, class: 'button' %>
</div>

<div class="admin_tax_rates">
  <table class='hover'>
    <thead>
    <tr class='odd'>
      <th class='column1_header'>Percentage</th>
      <th>
        <% if Settings.tax_per_state_id %>
          State
        <% else %>
          Country
        <% end %>
      </th>
      <th>Start date</th>
      <th>End date</th>
      <th>Active</th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
    </thead>

  <% @tax_rates.each do |tax_rate| %>
    <tr class='<%= cycle("odd", "")%>'>
      <td><%= tax_rate.percentage %></td>
      <% if Settings.tax_per_state_id %>
        <td><%= tax_rate.state.name %></td>
      <% else %>
        <td><%= tax_rate.country.name %></td>
      <% end %>
      <td><%= tax_rate.start_date %></td>
      <td><%= tax_rate.end_date %></td>
      <td><%= tax_rate.active.to_s %></td>
      <td><%= link_to 'Show', admin_config_tax_rate_path(tax_rate) %></td>
      <td><%= link_to 'Edit', edit_admin_config_tax_rate_path(tax_rate) %></td>
      <td><%= link_to 'Destroy', admin_config_tax_rate_path(tax_rate), data: { confirm: 'Are you sure?' }, method: :delete %></td>
    </tr>
  <% end %>
  </table>
</div>
